#ifndef CLIONPROJECT_COMMODITYCHAIN_H
#define CLIONPROJECT_COMMODITYCHAIN_H
#include "../StandardHeads.h"

struct CommodityNode{
    char commodityName[STR_MAX_LEN];
    double soldPrice;
    double purchasePrice;
    int unitCount;//当前件数
    struct CommodityNode * nextCommodity, * preCommodity;
};

void displayAllCommodities(struct CommodityNode * head);


void buildCommodityChain(struct CommodityNode ** head, struct CommodityNode ** tail);

void delCommodity(struct CommodityNode ** head, struct CommodityNode ** tail, struct CommodityNode * p);

void displayThisCommodity(struct CommodityNode * commodityDisplayPtr);

void rebuildCommodityFile(struct CommodityNode * head);

void addCommodity(struct CommodityNode ** head, struct CommodityNode ** tail);

void getUnitCount(struct RecordNode ** head, struct CommodityNode *p);

#endif //CLIONPROJECT_COMMODITYCHAIN_H
